using Tools.Domain.Specifications;
using Webshop20.Domain.Catalog.Core.Products;
using Webshop20.Domain.Shared.Products.Core;

namespace Webshop20.Domain.Catalog.Specifications
{
    public class MaximumPriceSpecification : Specification<Product>
    {
        public decimal? MaximumPrice { get; private set; }

        public MaximumPriceSpecification(decimal? maximumPrice) : base(product=>product.NetPrice <= maximumPrice, "MAXIMUM_PRICE_NOT_MATCHED")
        {
            MaximumPrice = maximumPrice;
        }
    }
}